<!DOCTYPE html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>投资网 | 注册</title>
    <meta name="keywords" content="投资,投资商城,在线投资网"/>
    <meta name="description" content="在线投资网用全新区块链技术，倾心打造。"/>
    <link href="./../../layui/css/layui.css" rel="stylesheet"/>
    <link href="./../../css/mall.css" rel="stylesheet"/>
    <style media="screen">
        body,
        html {
            height: 100%;
        }

        body {
            width: 100%;
            background: url('./../../images/bgimg.png') no-repeat;
            background-size: 100% auto;
        }
    </style>
</head>

<body class="">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header header_color">
        <div class="content header">
            <a href="javascript:" title="一个不一样的投资网">
                <div class="logo">
                    <img src="/images/face.jpg" class="logoimg"/>
                    <span>在线投资网</span>
                </div>
            </a>
            <ul class="layui-nav layui-layout-left daohang">
                <li class="layui-nav-item"><a href="/index.html">首页</a></li>
                <li class="layui-nav-item"><a href="/page/list/list.html">所有产品<span class="layui-badge-dot"></span></a>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="/page/reg/sign.html">
                        <i class="layui-icon">&#xe68e;</i> 登录
                    </a>
                </li>
                <li class="layui-nav-item userBox layui-hide">
                    <a href="javascript:;">
                        <img src="/images/face.jpg" class="layui-nav-img">喜欢狗的猫
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/user/set">基本信息</a></dd>
                        <dd><a class="login_out">安全退出</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
</div>
</div>
<div class="layui-container fly-marginTop loginbox">
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title">
                <li><a href="./sign.html">登录</a></li>
                <li class="layui-this">注册</li>
            </ul>
            <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form layui-form-pane">
                        <form method="post" action="/admin/reg">
                            <div class="layui-form-item">
                                <label class="layui-form-label">用户名</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">手机</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="tel" required lay-verify="phone" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" name="password" autocomplete="off" class="layui-input"
                                           required lay-verify="required">
                                </div>
                                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" lay-filter="register" lay-submit>立即注册</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="./../../layui/layui.all.js"></script>
<script src="./../../js/common.js"></script>
<script src="./../../js/default.js"></script>
<script>
    layui.use(['layer', 'form', 'element'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            form = layui.form,
            element = layui.element;

        form.on('submit(register)', function (data) {
            console.log(data.field);
            $.ajax({
                url: '/admin/reg',
                data: data.field,
                processData: true,
                cache: false,
                type: 'POST',
                async: false,
                contentType: "application/x-www-form-urlencoded", // 不设置内容类型
                success: function (json) {
                    var data = json.data;
                    var data = json.data;
                    if (json.status == "1") {
                        layer.msg('注册成功，请登录')
                        window.location.href = '/index'
                    }
                }
            });
            return false;
        });
    })
</script>
</body>
